const path = require('path') // 引入path模块
function resolve (dir) {
  return path.join(__dirname, dir) // path.join(__dirname)设置绝对路径
}

module.exports = {
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('./src'))
      .set('components', resolve('./src/components'))
      .set('views', resolve('./src/views')),
      config.set('externals', {
        'vue': 'Vue',
        "vue-router": "VueRouter",
        "lodash": "_",
        "axios": "axios",
        "echarts": "echarts"
      })
  }
}
